﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorInteractionProperty.h
 * @brief 读写HDF5文件的InteractionProperty类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-06-11
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORINTERACTIONPROPERTY_H__
#define  _FITKABAQUSHDF5ADAPTORINTERACTIONPROPERTY_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITKAbaqusHDF5AbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

 //前置声明
ForwardDeclarNS(Interface, FITKAbaAbstractInteractionProperty)

namespace IO
{
    /**
     * @brief HDF5 InteractionProperty 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-06-11
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorInteractionProperty : public FITKAbstractHDF5Adaptor
    {
    public:
        explicit FITKAbaqusHDF5AdaptorInteractionProperty() = default;
        virtual ~FITKAbaqusHDF5AdaptorInteractionProperty() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        bool adaptW() override;

    protected:

        /**
         * @brief 读取相互作用属性
         * @param property 相互作用属性
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        virtual bool readInteractionProperty(Interface::FITKAbaAbstractInteractionProperty* property, H5::Group& h5Group);

        /**
         * @brief 读取相互作用属性
         * @param property 相互作用属性
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool readInteractionPropertyContact(Interface::FITKAbaAbstractInteractionProperty* property, H5::Group& h5Group);

        /**
         * @brief 写出相互作用属性
         * @param property 相互作用属性
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        virtual bool writeInteractionProperty(Interface::FITKAbaAbstractInteractionProperty* property, H5::Group& h5Group);

        /**
         * @brief 写出相互作用属性
         * @param property 相互作用属性
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool writeInteractionPropertyContact(Interface::FITKAbaAbstractInteractionProperty* property, H5::Group& h5Group);

    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaAbstractInteractionProperty, FITKAbaqusHDF5AdaptorInteractionProperty)

}

#endif
